package com.fulong.service.impl;

import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fulong.common.utils.PageUtils;
import com.fulong.common.utils.Query;

import com.fulong.dao.DeviceJobInfoDao;
import com.fulong.entity.DeviceJobInfoEntity;
import com.fulong.service.DeviceJobInfoService;


@Service("deviceJobInfoService")
public class DeviceJobInfoServiceImpl extends ServiceImpl<DeviceJobInfoDao, DeviceJobInfoEntity> implements DeviceJobInfoService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        //分页问题
        int currentpage  = 1 ;
        if(params.get("page")!=null) {
            currentpage = Integer.parseInt(params.get("page").toString());
            params.remove("page") ;
        }
        HashMap<String , Object> map = new HashMap<>();
        IPage<DeviceJobInfoEntity> page = this.page(
                new Query<DeviceJobInfoEntity>().getPage(params),
                new QueryWrapper<DeviceJobInfoEntity>()
        );

        return new PageUtils(page);
    }

}